Carbon


RectInIconRef

Header: Icons.h Carbon status: Supported

Tests whether a specified rectangle falls within an icon’s mask.

Boolean RectInIconRef (
    const Rect *testRect, 
    const Rect *iconRect, 
    IconAlignmentType align, 
    IconServicesUsageFlags iconServicesUsageFlags, 
    IconRef theIconRef
);
testRect

A pointer to the rectangle, specified in local coordinates of the current graphics port, that Icon Services tests to see whether it falls within the mask of the indicated icon.

iconRect

A pointer to the area that Icon Services uses to determine which icon is hit-tested. Use the same Rect value as when the icon was last drawn.

align

A value that specifies how the indicated icon is aligned within the rectangle specified in the iconRect parameter. Use the same IconAlignmentType value as when the icon was last drawn. for a description of possible return values, see “Icon Alignment Constants”.

iconServicesUsageFlags

Reserved for future use. Pass the kIconServicesDefaultUsageFlags constant in this parameter.

theIconRef

A pointer to a value of type IconRef specifying the icon family to use for drawing the requested icon.

function result

true if the rectangle specified in the testRect parameter intersects the appropriate icon mask, false otherwise.

DISCUSSION

This function is similar to the Icon Utilities function RectInIconSuite. The function is useful when you want to determine whether a user selection intersects a particular icon, for example.

Icon Services uses the icon’s black-and-white mask for hit-testing, even if you provide a deep mask.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when IconServicesLib 8.5 or later is installed. Exported by CarbonLib 1.0 and later and by IconServicesLib 8.5 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/18/2000)